# !/usr/bin/python
# -*- coding: utf-8 -*-

# 爬虫工具类
import bs4
import requests

# 获取网页数据
def get_request(url):
    # 模拟浏览器发送http请求
    response = requests.get(url)
    # 设置编码为网站的编码
    response.encoding = response.apparent_encoding
    # 获取到该网站的所有内容
    html = response.text
    soup = bs4.BeautifulSoup(html, 'html.parser')
    return soup


